package com.example.administrator.mobile;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import java.util.Map;

public class QQLogin extends AppCompatActivity {

    EditText mima ;
    EditText mEtUsername;
    Button login;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_qqlogin);
        mima=findViewById(R.id.et_mima);

        mEtUsername  = findViewById(R.id.et_username);

        login = findViewById(R.id.btn_login);



        login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                if (mEtUsername.getText().toString().equals("admin")&&mima.getText().toString().equals("123")){

                    Intent intent = new Intent(QQLogin.this,MainActivity.class);

                    startActivity(intent);

                    Toast.makeText(QQLogin.this,"登录成功",Toast.LENGTH_SHORT).show();
                }else {
                    Toast.makeText(QQLogin.this,"用户名或密码错误",Toast.LENGTH_SHORT).show();
                }

            }
        });


    }

    private void initView() {
    }

    public void guanbi(View view) {

        Intent intent = new Intent(this,Login.class);

        startActivity(intent);

        Toast.makeText(QQLogin.this,"登录失败",Toast.LENGTH_SHORT).show();
    }
}
